import QtQuick 2.0

Grid {
    spacing: 10
    Repeater {
        model: ListModel {
            ListElement { name: "Apple"; flagColor: "red" }
            ListElement { name: "Bnana"; flagColor: "blue" }
            ListElement { name: "Watermelon"; flagColor: "green" }
            ListElement { name: "Pine"; flagColor: "orange" }
            ListElement { name: "Rice"; flagColor: "yellow" }
            ListElement { name: "KFC"; flagColor: "gray" }
        }

        delegate: Rectangle {
            width: 150
            height: 150
            radius: 30
            color: "lightblue"
            Rectangle {
                anchors.top: parent.top
                anchors.topMargin: 40
                anchors.horizontalCenter: parent.horizontalCenter
                width: 20
                height: 20
                radius: 20
                color: flagColor
            }
            Text {
                anchors.top: parent.top
                anchors.topMargin: 80
                anchors.horizontalCenter: parent.horizontalCenter
                text: name
                color: "black"
                font.family: "SimHei"
                font.pixelSize: 20
                font.bold: true
            }
        }
    }
}
